﻿using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;


namespace UDS.Management
{
    [RunInstaller(true)]
    public partial class UDSManagementServiceInstaller : Installer
    {
        private ServiceInstaller serviceInstaller;
        private ServiceProcessInstaller processInstaller;

        public UDSManagementServiceInstaller()
        {
            InitializeComponent();

            processInstaller = new ServiceProcessInstaller();
            serviceInstaller = new ServiceInstaller();

            // Service will run under system account
            processInstaller.Account = ServiceAccount.LocalSystem;

            // Service will have Start Type of Manual
            serviceInstaller.StartType = ServiceStartMode.Automatic;

            serviceInstaller.ServiceName = "UDS Management Service";

            Installers.Add(serviceInstaller);
            Installers.Add(processInstaller);
        }
    }
}
